package cn.shyouchi.wuguanjia.android.ui.home.security.thread.message.casual;

import android.content.Intent;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import cn.shyouchi.wuguanjia.android.R;

/**
 * Created by Eenie on 2017/3/29 at 17:24
 * Email: 472279981@qq.com
 * Des:
 */

public class CasualAdapter extends BaseQuickAdapter<CasualNotice, BaseViewHolder> {
    public CasualAdapter(List<CasualNotice> data) {
        super(R.layout.item_casual_layout, data);


    }

    @Override
    protected void convert(BaseViewHolder holder, final CasualNotice casualNotice) {
        holder.setText(R.id.model_name, casualNotice.getTitle());
        holder.setText(R.id.tv_holder_name, casualNotice.getCreated_at());

        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mContext.startActivity(new Intent(mContext, ShowCasualActivity.class).putExtra("error", casualNotice));
            }
        });
    }
}
